<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="test"></div>
    <script src="./js/react.development.js"></script>
    <script src="./js/react-dom.development.js"></script>
    <script src="./js/babel.min.js"></script>
    <script type="text/babel">
        // 创建函数式组件
        function Demo() {//组件的首字母要大写
            console.log(this)//这里的this式undefined，因为babel开启了严格模式
            return <h2>我是用函数定义的组件(适用于[简单的组件]的定义)</h2>
        }
        ReactDOM.render(<Demo/>, document.getElementById('test'))
        /*
            执行了ReactDOM.render(<Demo/>,****)
                1.React解析了组件标签。找到组件
                2.发现组件后会帮你调用并且渲染
        */ 
    </script>
</body>
</html>